<?php

    $page_title = "Boxing Home";
    include 'includes/header.php';
    include 'includes/common.php';

    $q = "SELECT new_id, new_title, new_text, new_pic_loc, UNIX_TIMESTAMP(timestamp) as timestamp1
    FROM news ORDER BY timestamp DESC LIMIT 0,2";

    $result = mysqli_query($db_connect, $q);

    $arrayHolder = array(array());

    while($row = mysqli_fetch_assoc($result)) {
        static $i=0;
        $arrayHolder[$i]['new_id'] = $row['new_id'];
        $arrayHolder[$i]['new_title'] = $row['new_title'];
        $arrayHolder[$i]['new_text'] = $row['new_text'];
        $arrayHolder[$i]['new_pic_loc'] = $row['new_pic_loc'];
        $arrayHolder[$i]['new_post_date'] = date('d. F, Y', $row['timestamp1']);
        $arrayHolder[$i]['new_post_hour'] = date('H:i', $row['timestamp1']);
        $i++;
    }

?>
	<!--Billboard-->
	<div id="container_billboard">
		<div id="billboard_big">
            <div class="b_1 active"><img src="img/slider.jpg" alt=""></div>
            <div class="b_2"><img src="img/slider2.jpg" alt=""></div>
            <div class="b_3"><img src="img/slider3.jpg" alt=""></div>
            <div class="b_4"><img src="img/slider4.jpg" alt=""></div>
		</div>
		<div class="b_1 billboard_small">
			<img src="img/slider_s.jpg" alt="">
        </div>
        <div class="b_2 billboard_small">
            <img src="img/slider2_s.jpg" alt="">
        </div>
        <div class="b_3 billboard_small">
            <img src="img/slider3_s.jpg" alt="">
        </div>
        <div class="b_4 billboard_small">
            <img src="img/slider4_s.jpg" alt="">
        </div>

	</div>
	<!-- web content -->
	<div id="container_content">
		<div id="welcome">
			<h2>Добре дошли в нашия сайт</h2>
			<p>
				Боксов клуб Академик разполага с просторна и модерна зала, изградена по европейски стандарти и
                снабдена с професионално оборудване, което гарантира на състезателите ползотворни и приятни тренировки.
                За начинащите в бокса и кик-бокса ще се погрижат нашите специално обучени професионални треньори.
			</p>
			<a href="about_us.php"><img src="img/learn_more.png" alt=""></a>
		</div>
		<div id="news">
			<h2><a href="news_page.php">Последни Новини</a></h2>
			<div class="news_holder">
				<div class="img_container">
					<img src="<?php echo $arrayHolder[0]['new_pic_loc'] ?>" alt="">
                </div>
				<div class="news_info">
					<h3><?php echo $arrayHolder[0]['new_title'] ?></h3>
					<ul class="da">
						<li class="date"><?php echo $arrayHolder[0]['new_post_date'] ?></li>
						<li class="answeres">5</li>
					</ul>

                </div>
			</div>
			<div class="news_holder">
				<div class="img_container">
					<img src="<?php echo $arrayHolder[1]['new_pic_loc'] ?>" alt="">
                </div>
				<div class="news_info">
                    <h3><?php echo $arrayHolder[1]['new_title'] ?></h3>
                    <ul class="da">
                        <li class="date"><?php echo $arrayHolder[1]['new_post_date'] ?></li>
                        <li class="answeres">5</li>
                    </ul>
				</div>
			</div>
		</div>
		<div id="trainers">
			<h2>Треньори</h2>
			<div class="trainers_info">
				<a href="about_us.php"><img src="img/small/valentin.jpg" alt="">
				<h3>Валентин <br/> Давидов</h3></a>
			</div>
			<div class="trainers_info">
				<a href="about_us.php"><img src="img/small/mefata.jpg" alt="">
				<h3>Марин <br/> Чонгов</h3></a>
			</div>
			<div class="trainers_info">
				<a href="about_us.php"><img src="img/small/boiko.jpg" alt="">
				<h3>Бойко <br/> Карабойков</h3></a>
			</div>
		</div>
	</div>
	<div id="working_time">
		<div id="youtube">
			<h2>Видео</h2>
			<div class="youtube_holder">
				<div class="video_container">
					<iframe width="300" height="200" src="//www.youtube.com/embed/FULhsxLL2ZU" frameborder="0" allowfullscreen>
					</iframe>
				</div>
			</div>
			<div class="youtube_holder">
				<div class="video_container">
					<iframe width="300" height="200" src="//www.youtube.com/embed/-uvutY737S8" frameborder="0" allowfullscreen>
					</iframe>
				</div>
			</div>
		</div>
		<div id="schedule">
			<h2>График</h2>
			<h3><a href="schedule.php">Виж Пълния График</a></h3>
			<table>
			<tr>
				<td>
					Понеделник
				</td>
				<td>
					<span>9:30-11:00</span>
				</td>
			</tr>
			<tr>
				<td>
					Вторник
				</td>
				<td>
					<span>11:00-12:30</span>
				</td>
			</tr>
			<tr>
				<td>
					Сряда
				</td>
				<td>
					<span>17:00-18:30</span>
				</td>
			</tr>
			<tr>
				<td>
					Четвъртък
				</td>
				<td>
					<span>18:30-20:00</span>
				</td>
			</tr>
			<tr>
				<td>
					Петък
				</td>
				<td>
					<span>19:30-21:00</span>
				</td>
			</tr>
			<tr>
				<td>
					Събота
				</td>
				<td>
					<span>11:00-13:00</span>
				</td>
			</tr>
			</table>
		</div>
	</div>

<?php

    include 'includes/footer.php';

?>